@layout("/common/_curd/_container.html"){
<script type="text/javascript">
	var ctx="${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	var export_source = "user.oraclelist";
	if("${func.isMySql()}" == "true"){
		export_source = "user.mysqllist";
	}
	
	$(function(){
		initGrid();
	});
	
	function initGrid(){
		var grid_url = ctx+"/${code}/list";//查询列表接口
		var _colnames=[ "序列", "姓名","部门"];
		var _colmodel=[   {name:"ID",index:"ID", width:80,hidden:true},
						  {name:"NAME",index:"NAME", width:80},
						  {name:"DEPTNAME",index:"DEPTID", width:50}
						];
		
		jQuery(grid_selector).jqGrid({
			url:grid_url,
			//caption: "用户管理",
		    shrinkToFit:true,//适用于较少字段,响应式
			colNames:_colnames,
			colModel:_colmodel, 
			jsonReader:{id:"ID"},
			pager : pager_selector,
			postData: { sort: "status asc, account", order: "asc"}
		});
		

	}
	
	

</script>


	<!-- 配置grid -->
	<div class="row">

		<div class="col-xs-12 tb-grid">
			<!-- 配置查询 -->
			@ var _col=[
			@		  	{name:"姓名",index:"NAME",type:"text"}
			@		   ];
			@ include("/common/_function/_search.html",{"col":_col}){}
			<!-- 按钮组 -->
			<div>
				<button onclick="choose()">确定</button>
			</div>
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
<script>
	choose = function () {
		var ids = $("#grid-table").jqGrid("getGridParam", "selarrrow");
		var row = $("#grid-table").jqGrid('getRowData', ids.toString());
        if(ids.length < 1){
            layer.msg("请选择一项")
            return
        }
		parent.document.getElementById("_u_id").value=ids.toString();
		parent.document.getElementById("_u_name").value=row.NAME;
		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
		parent.layer.close(index); //再执行关闭
	}
</script>
	
	<!-- 引入列表页所需js -->
	@include("/common/_listscript.html"){}
@}